﻿using System;
using System.Globalization;
using System.Windows.Data;
using System.Collections.Generic;

namespace MainGameModule.Views.Converters
{
    public class StringToImageSourceConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (string.IsNullOrEmpty((string)value))
            {
                List<string> kids = new List<string>()
                {
                    "/MainGameModule;component/Images/Girl/right/kid0001.png",
                    "/MainGameModule;component/Images/Moli/right/kid0001.png",
                    "/MainGameModule;component/Images/Moni/right/kid0001.png",
                    "/MainGameModule;component/Images/Boy/left/kid0001.png",
                    "/MainGameModule;component/Images/Kido/left/kid0001.png",
                    "/MainGameModule;component/Images/Sebastian/left/kid0001.png",
                };

                Random rand_kid = new Random();
                return kids[rand_kid.Next(0, 5)];
            }
            else
            {
                return (string)value;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
